#pragma once
#include"hashtable.h"

namespace Z
{
	template<class K, class Hash = HashFunc<K>>
	class UnorderedSet
	{
		struct SetKOfT
		{
			const K& operator()(const K& key)
			{
				return key;
			}
		};
	public:
		typedef typename HashTable<K, const K, SetKOfT, Hash>::Iterator iterator;
		typedef typename HashTable<K, const K, SetKOfT, Hash>::ConstIterator const_iterator;

		iterator begin()
		{
			return _ht.Begin();
		}
		iterator end()
		{
			return _ht.End();
		}
		const_iterator begin()const
		{
			return _ht.Begin();
		}
		const_iterator end()const
		{
			return _ht.End();
		}
		pair<iterator, bool> Insert(const K& key)
		{
			return _ht.Insert(key);
		}
		iterator find(const K& key)
		{
			return _ht.Find();
		}
		bool erase()
		{
			return _ht.Erase();
		}
		
	private:
		HashTable<K, K, SetKOfT, Hash> _ht;

	};
}